package com.xpec.cipher.tals.record;

import com.xpec.cipher.tals.TalsConstance;


public class ServerHelloRecord extends HandShakeRecord {
	public byte[] data;

	public ServerHelloRecord(byte[] data) {
		this.data = data;
	}

	@Override
	protected int getContentLengthWithoutHandShakeTypeSize() {
		return TalsConstance.SERVER_HELLO_SIZE;
	}

	@Override
	protected byte getHandShakeType() {
		return TalsConstance.HAND_SHAKE_TYPE_SERVER_HELLO;
	}

	@Override
	protected byte[] resolveSubStructWithoutHandShakeType() {
		byte[] buffer = new byte[TalsConstance.SERVER_HELLO_SIZE];
		System.arraycopy(data, 0, buffer, 0, TalsConstance.SERVER_HELLO_SIZE);
		return buffer;
	}
}
